﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CardGame
{
    public abstract class TableBase
    {
        protected Dealer dealer;
        public Player[] Players { get; private set; }

        public TableBase(params Player[] players)
        {
            if (players == null)
            {
                throw new ArgumentNullException("players", "You must specify the players.");
            }
            
            if (players.Length == 0)
            {
                throw new ArgumentOutOfRangeException("players", "You must specify at least one player.");
            }

            if (players.Any(player => player == null))
            {
                throw new ArgumentOutOfRangeException("players", "All players must not be null.");
            }

            this.Players = players;
        }
    }
}